home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
QRZ! Ham Radio 4
/
QRZ Ham Radio Callsign Database - Volume 4.iso
/
files
/
packet
/
ohmqkdlc
/
diffs.txt
< prev
next >
Wrap
Text File
|
1994-11-27
|
12KB
|
444 lines
Diffs against KA9Q S930104 -source set for creating OH1MQK [mea@utu.fi]
features -- and his DDLC card driver, and new encoding type ("HDLC")...
Files ddlc.c, ddlc.h, ddlcvec.s, ddlc.txt, ddlc.doc, ddlctest.c, rawhdlc.c
and rawhdlc.h are provided separately. (ddlcpack.lzh)
Phil had made (in display.c) the query of actual screen size, and thus there
is no longer need for OH1MQK mod for it -- in stdio.c...
(Try with DOS 4/5: MODE CON LINES=50, and then start NET)
Rundown:
config.h: Added DDLC-, and RAWHDLC-options, turned this & that on..
config.c: Added DDLC and RAWHDLC -drivers, and couple of *_helper()-
routines. ( attach_helper(), start_helper(), stop_helper() )
commands.h: Added DDLC and RAWHDLC related commans.
cmdparse.c: Added new feature into cmdparse() -routine: it can call up
*_helper() -routines if needed.
netuser.c: Corrected IP-number parsing to conform usual Internet style:
127.1 == 127.0.0.1, NOT 127.1.0.0 !
*** config.h 1992/12/28 09:05:29 1.22
--- config.h 1993/01/06 03:31:32
***************
*** 9,19 ****
#define RIP 1 /* Include RIP routing */
#define HOPCHECK 1 /* IP path tracing command */
#define DIALER 1 /* SLIP redial code */
! #undef NRS 1 /* NET/ROM async interface */
! #undef NETROM 1 /* NET/ROM network support */
#undef LZW 1 /* LZW-compressed sockets */
#define SLIP 1 /* Serial line IP on built-in ports */
! #undef PPP 1 /* Point-to-Point Protocol code */
#define VJCOMPRESS 1 /* Van Jacobson TCP compression for SLIP */
#define TRACEBACK 1 /* Stack traceback code */
#undef LOCSOCK 1 /* Local loopback sockets */
--- 9,19 ----
#define RIP 1 /* Include RIP routing */
#define HOPCHECK 1 /* IP path tracing command */
#define DIALER 1 /* SLIP redial code */
! #define NRS 1 /* NET/ROM async interface */
! #define NETROM 1 /* NET/ROM network support */
#undef LZW 1 /* LZW-compressed sockets */
#define SLIP 1 /* Serial line IP on built-in ports */
! #define PPP 1 /* Point-to-Point Protocol code */
#define VJCOMPRESS 1 /* Van Jacobson TCP compression for SLIP */
#define TRACEBACK 1 /* Stack traceback code */
#undef LOCSOCK 1 /* Local loopback sockets */
***************
*** 31,46 ****
#undef HS 1 /* High speed (56kbps) modem driver */
#undef HAPN 1 /* Hamilton Area Packet Network driver code */
#undef EAGLE 1 /* Eagle card driver */
! #undef PI 1 /* PI card driver */
#define PACKET 1 /* FTP Software's Packet Driver interface */
#undef PC100 1 /* PAC-COM PC-100 driver code */
#undef APPLETALK 1 /* Appletalk interface (Macintosh) */
! #undef DRSI 1 /* DRSI PCPA slow-speed driver */
#undef SCC 1 /* PE1CHL generic scc driver */
#define ASY 1 /* Asynch driver code */
! #undef SLFP 1 /* SLFP packet driver class supported */
! #define CDMA_DM 1 /* CDMA mobile DM interface */
#undef QTSO 1 /* CDMA QTSO data interface */
#if defined(NRS)
#undef NETROM
--- 31,48 ----
#undef HS 1 /* High speed (56kbps) modem driver */
#undef HAPN 1 /* Hamilton Area Packet Network driver code */
#undef EAGLE 1 /* Eagle card driver */
! #define PI 1 /* PI card driver */
#define PACKET 1 /* FTP Software's Packet Driver interface */
#undef PC100 1 /* PAC-COM PC-100 driver code */
#undef APPLETALK 1 /* Appletalk interface (Macintosh) */
! #define DRSI 1 /* DRSI PCPA slow-speed driver */
#undef SCC 1 /* PE1CHL generic scc driver */
#define ASY 1 /* Asynch driver code */
! #undef SLFP 1 /* SLFP packet driver class supported */
! #undef CDMA_DM 1 /* CDMA mobile DM interface */
#undef QTSO 1 /* CDMA QTSO data interface */
+ #define DDLC 1 /* OH1MQK's DDLC-card driver [mea@utu.fi] */
+ #define AX25 1 /* the DDLC card can do without as well.. */
#if defined(NRS)
#undef NETROM
***************
*** 58,63 ****
--- 60,69 ----
#if (defined(PC_EC) || defined(PACKET))
#define ETHER 1 /* Generic Ethernet code */
+ #endif
+
+ #if (defined(DDLC))
+ #define RAWHDLC 1 /* Raw HDLC framing on the link */
#endif
#if defined(CMDA_DM)
*** config.c 1992/12/30 10:56:44 1.42
--- config.c 1993/01/06 04:45:14
***************
*** 48,53 ****
--- 48,56 ----
#ifdef QTSO
#include "qtso.h"
#endif
+ #ifdef RAWHDLC /* OH1MQK [mea@utu.fi] */
+ #include "rawhdlc.h"
+ #endif
#ifdef CDMA_DM
#include "dm.h"
#endif
***************
*** 57,62 ****
--- 60,71 ----
static int dostart __ARGS((int argc,char *argv[],void *p));
static int dostop __ARGS((int argc,char *argv[],void *p));
+ static void attach_helper __ARGS((int argc, char *line));
+ #ifdef SERVERS
+ static void start_helper __ARGS((int argc, char *line));
+ static void stop_helper __ARGS((int argc, char *line));
+ #endif
+
#ifdef AX25
static void axip __ARGS((struct iface *iface,struct ax25_cb *axp,char *src,
char *dest,struct mbuf *bp,int mcast));
***************
*** 98,105 ****
--- 107,119 ----
#ifdef ASY
"asystat", doasystat, 0, 0, NULLCHAR,
#endif
+ #if 1 /* [mea@utu.fi] I try my magic helper functions.. */
+ "attach", doattach, 0, -2,
+ (void*)attach_helper,
+ #else
"attach", doattach, 0, 2,
"attach <hardware> <hw specific options>",
+ #endif
#ifdef AX25
"ax25", doax25, 0, 0, NULLCHAR,
#endif
***************
*** 118,123 ****
--- 132,140 ----
"close", doclose, 0, 0, NULLCHAR,
/* This one is out of alpabetical order to allow abbreviation to "d" */
"disconnect", doclose, 0, 0, NULLCHAR,
+ #ifdef DDLC
+ "ddlc", do_ddlc, 0, 2, "ddlc <cmd>",
+ #endif
"delete", dodelete, 0, 2, "delete <file>",
"detach", dodetach, 0, 2, "detach <interface>",
#ifdef DIALER
***************
*** 220,228 ****
--- 237,250 ----
"smtp", dosmtp, 0, 0, NULLCHAR,
"socket", dosock, 0, 0, NULLCHAR,
#ifdef SERVERS
+ #if 1 /* [mea@utu.fi] Try start_helper(), stop_helper() */
+ "start", dostart, 0, -2, (void*)start_helper,
+ "stop", dostop, 0, -2, (void*)stop_helper,
+ #else
"start", dostart, 0, 2, "start <servername>",
"stop", dostop, 0, 2, "stop <servername>",
#endif
+ #endif
"tcp", dotcp, 0, 0, NULLCHAR,
"telnet", dotelnet, 1024, 2, "telnet <address>",
#ifdef notdef
***************
*** 321,326 ****
--- 343,357 ----
" <intack> <vec> [p]<clock> [hdwe] [param]\n"
"attach scc <chan> slip|kiss|nrs|ax25ui|ax25i <label> <mtu> <speed> <bufsize> [call] ",
#endif
+ #ifdef DDLC
+ "ddlc", ddlc_attach, 0, 5,
+ "attach ddlc init <memaddr> <vec> [<size>]\n"
+ "\tattach ddlc <chan> "
+ #ifdef AX25
+ "ax25|"
+ #endif
+ "hdlc <label> <mtu> <speed> <duplex> [ip-addr]",
+ #endif
NULLCHAR,
};
***************
*** 659,664 ****
--- 690,702 ----
NULLFP, sl_dump, dd_init, dd_stat,
#endif
+ #ifdef RAWHDLC /* [mea@utu.fi] */
+ "HDLC", hdlc_send, hdlc_output, NULL,
+ NULL, CL_NONE, 0, ip_proc,
+ NULLFP, ip_dump, NULLFP, NULLFP,
+ /* same DirectDialing, as with CDMA? */
+ #endif /* RAWHDLC */
+
NULLCHAR, NULLFP, NULLFP, NULL,
NULL, -1, 0, NULLFP,
NULLFP, NULLVFP, NULLFP, NULLFP,
***************
*** 712,717 ****
--- 750,758 ----
#ifdef SCC
scctimer,
#endif
+ #ifdef DDLC /* [mea@utu.fi] */
+ ddlctimer,
+ #endif
NULL,
};
***************
*** 735,740 ****
--- 776,784 ----
#ifdef SCC
sccstop,
#endif
+ #ifdef DDLC /* [mea@utu.fi] */
+ ddlcstop,
+ #endif
uchtimer, /* Unlink timer handler from timer chain */
NULLVFP,
};
***************
*** 905,911 ****
--- 949,1027 ----
}
#endif /* !defined(VJCOMPRESS) && defined(ASY) */
+
+ static void
+ attach_helper(argc,line)
+ int argc;
+ char *line;
+ {
+ struct cmds *cmdp = Attab;
+ int col = 0, siz;
+
+ printf("attach <device> <arg(s)> -- with possible devices:\n");
+ for (;cmdp->name;++cmdp) {
+ if (col == 0) printf(" ");
+ siz = strlen(cmdp->name);
+ printf("%s ",cmdp->name);
+ col += siz + 1;
+ if (col > 60) {
+ printf("\n");
+ col = 0;
+ }
+ }
+ if (col)
+ printf("\n");
+ }
+
+
#ifdef SERVERS
+ static void
+ start_helper(argc,line)
+ int argc;
+ char *line;
+ {
+ struct cmds *cmdp = Startcmds;
+ int col = 0, siz;
+
+ printf("start <service> -- with possible services:\n");
+ for (;cmdp->name;++cmdp) {
+ if (col == 0) printf(" ");
+ siz = strlen(cmdp->name);
+ printf("%s ",cmdp->name);
+ col += siz + 1;
+ if (col > 60) {
+ printf("\n");
+ col = 0;
+ }
+ }
+ if (col)
+ printf("\n");
+ }
+
+ static void
+ stop_helper(argc,line)
+ int argc;
+ char *line;
+ {
+ struct cmds *cmdp = Stopcmds;
+ int col = 0, siz;
+
+ printf("stop <service> -- with possible services:\n");
+ for (;cmdp->name;++cmdp) {
+ if (col == 0) printf(" ");
+ siz = strlen(cmdp->name);
+ printf("%s ",cmdp->name);
+ col += siz + 1;
+ if (col > 60) {
+ printf("\n");
+ col = 0;
+ }
+ }
+ if (col)
+ printf("\n");
+ }
+
+
static int
dostart(argc,argv,p)
int argc;
*** commands.h 1992/12/28 09:04:56 1.13
--- commands.h 1993/01/06 04:14:10
***************
*** 28,33 ****
--- 28,39 ----
/* In bootpd.c */
int bootpdcmd __ARGS((int argc,char *argv[],void *p));
+ /* In ddlc.c: [mea@utu.fi] */
+ int do_ddlc __ARGS((int argc,char *argv[],void *p));
+ int ddlc_attach __ARGS((int argc,char *argv[],void *p));
+ void ddlctimer __ARGS((void)); /* XX: ?? */
+ void ddlcstop __ARGS(()); /* XX: ?? */
+
/* In dialer.c: */
int dodialer __ARGS((int argc,char *argv[],void *p));
*** cmdparse.c 1992/05/01 08:20:24 1.4
--- cmdparse.c 1993/01/06 04:03:22
***************
*** 8,13 ****
--- 8,16 ----
* bit16cmd for PPP
* Mar '91 - Glenn McGregor
* handle string escaped sequences
+ * Jul '92 - Matti Aarnio, OH1MQK [mea]
+ * if argcmin < 0, then argc_errmsg is a pointer to
+ * a helper routine which uses arguments: argc, line
*/
#include <stdio.h>
#include "global.h"
***************
*** 188,193 ****
--- 191,202 ----
printf("Usage: %s\n",cmdp->argc_errmsg);
return -1;
}
+ /* [mea] If NEGATIVE argcmin, call a procedure to report an error! */
+ if(argc < -(cmdp->argcmin)) {
+ /* Insufficient arguments */
+ (*(void(*)())cmdp->argc_errmsg)(argc,line);
+ return -1;
+ }
if(cmdp->func == NULLFP)
return 0;
if(cmdp->stksize == 0){
***************
*** 245,250 ****
--- 254,265 ----
if(argc < cmdp->argcmin){
if(cmdp->argc_errmsg != NULLCHAR)
printf("Usage: %s\n",cmdp->argc_errmsg);
+ return -1;
+ }
+ /* [mea@utu.fi] */
+ if(argc < -(cmdp->argcmin)) {
+ /* Insufficient arguments */
+ (*(void(*)())cmdp->argc_errmsg)(argc,argv);
return -1;
}
if(cmdp->stksize == 0){
*** netuser.c 1992/06/21 08:42:10 1.2
--- netuser.c 1993/01/06 05:02:50
***************
*** 11,26 ****
/* Convert Internet address in ascii dotted-decimal format (44.0.0.1) to
* binary IP address
*/
int32
aton(s)
register char *s;
{
! int32 n;
register int i;
n = 0;
if(s == NULLCHAR)
return 0;
for(i=24;i>=0;i -= 8){
--- 11,28 ----
/* Convert Internet address in ascii dotted-decimal format (44.0.0.1) to
* binary IP address
+ * [mea@utu.fi]: Remember that 127.0.0.1 == 127.1 -- in most systems anyway!
*/
int32
aton(s)
register char *s;
{
! int32 n, m;
register int i;
n = 0;
+ m = 0; /* [mea@utu.fi] */
if(s == NULLCHAR)
return 0;
for(i=24;i>=0;i -= 8){
***************
*** 29,40 ****
s++;
if(*s == '\0')
break;
! n |= (int32)atoi(s) << i;
if((s = strchr(s,'.')) == NULLCHAR)
break;
s++;
}
! return n;
}
/* Convert an internet address (in host byte order) to a dotted decimal ascii
* string, e.g., 255.255.255.255\0
--- 31,43 ----
s++;
if(*s == '\0')
break;
! m = (int32)atoi(s);
if((s = strchr(s,'.')) == NULLCHAR)
break;
+ n |= m << i;
s++;
}
! return n | m;
}
/* Convert an internet address (in host byte order) to a dotted decimal ascii
* string, e.g., 255.255.255.255\0